Skip to content

HlslParseContext should respect global uniform block name override by intermediate - #3949

Closed
MohammadMDSA wants to merge 1 commit into
KhronosGroup:mainfrom
MohammadMDSA:main
Closed

HlslParseContext should respect global uniform block name override by intermediate#3949
MohammadMDSA wants to merge 1 commit into
KhronosGroup:mainfrom
MohammadMDSA:main

Conversation

@MohammadMDSA

Copy link
Copy Markdown

HlslParseContext should respect global uniform block name override by intermediate.
Currently global uniform block name resolved by hlsl parse context is always "$Global" (not even "$Globals" for compatibility with DXC). While the TShader accepts override name for the global block and even TParseContext respects it, it wouldn't work with hlsl. With this change, HlslParseContext would also respect the name override.

@CLAassistant

CLAassistant commented Apr 29, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dnovillo dnovillo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no test exercising this new functionality. Could you add some?

const char* HlslParseContext::getGlobalUniformBlockName() const
{
const char* name = intermediate.getGlobalUniformBlockName();
if (std::string(name) == "")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is allocating a string just to compare against an empty literal. Please compare name[0] == '\0'.

@MohammadMDSA

Copy link
Copy Markdown
Author

Hey @dnovillo I'd love to, but because of the agreement I've signed with my workplace, I can no longer contribute to this repo. I am so sorry

@dnovillo

Copy link
Copy Markdown
Collaborator

Hey @dnovillo I'd love to, but because of the agreement I've signed with my workplace, I can no longer contribute to this repo. I am so sorry

OK, thanks. Absolutely fine. In that case, it's probably better to close this PR. If in the future you happen to be able to contribute again, you can re-open it. Thanks.

@dnovillo dnovillo closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants